import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

const state = {
    isZh: localStorage.getItem("lang") ? localStorage.getItem("lang") === "zh-CN" : true, // 语言状态
}

const mutations = {
    SET_IS_ZH(state, isZh) {
      console.log('isZh :>> ', isZh);
      state.isZh = isZh
    },
}

const actions = {
    
}

const getters = { 
    isZh: (state) => {
      const lang = state.isZh
      // console.log('lang :>> ', lang);
      return lang
    },
}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
}
